package org.colcon.web.model.proposal;

import java.util.LinkedList;
import java.util.List;

import org.colcon.web.model.Model;
import org.colcon.web.model.Proposal;
import org.colcon.web.model.framework.IBallot;

public abstract class MultiChoiceVoteProposal extends Proposal 
{
	private static final long serialVersionUID = 4460583731256944110L;
	
	public MultiChoiceVoteProposal()
	{
		this(Model.NULL, Model.NULL, 0, 0, new String[0], 0, 0);
	}
	
	public MultiChoiceVoteProposal(String group, String name, int length, int quorum, String[] voters, int voteLength, int voteQuorum) 
	{
		super(group, name, length, quorum, voters, voteLength, voteQuorum);
	}
	
	public List<Object> getChoices()
	{
		//TODO: add title requirements
		
		List<Object> list = new LinkedList<Object>();
		
		//TODO: fix warning
		for(IBallot ballot : getBallots())
			if(!list.contains(ballot.getValue()))
				list.add((Object) ballot.getValue());
		
		return list;
	}
}
